package org.springblade.modules.repair.vo.statistics;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description 作业汇总-个人
 * @Author ysq
 * @Date 2022/8/26
 **/
@Data
public class PersonalWorkSummaryVO {

	@ApiModelProperty(value = "实际作业天数")
	private long workDayCount;

	@ApiModelProperty(value = "休息天数")
	private long holidayCount;

	@ApiModelProperty(value = "累均作业时长")
	private BigDecimal workTimeTotal;

	@ApiModelProperty(value = "日均作业时长")
	private BigDecimal divDayWorkTime;

	public BigDecimal getWorkTimeTotal() {
		if (this.workTimeTotal == null) {
			this.workTimeTotal = BigDecimal.ZERO.setScale(2);
		}
		return workTimeTotal;
	}

	public BigDecimal getDivDayWorkTime() {
		if (this.divDayWorkTime == null) {
			this.divDayWorkTime = BigDecimal.ZERO.setScale(2);
		}
		return divDayWorkTime;
	}

	public void setWorkTimeTotal(Integer workTimeTotal) {
		this.workTimeTotal = new BigDecimal(workTimeTotal).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public void setDivDayWorkTime(Integer divDayWorkTime) {
		this.divDayWorkTime = new BigDecimal(divDayWorkTime).divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}
}
